<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../application/vue.js"></script>
</head>
<body>
    <div id="app">
        <p>{{msg}}</p>
        <p v-text="msg"></p>
        <hr>
        <p>{{getMsg}}</p>
        <p v-text="getMsg"></p>
        <input type="button" value="赋值" @click="getMsg='庞统'">
        <hr>
        <p>{{func()}}</p>
        <p v-text="func()"></p>
        <hr>
        <p>{{getInfo}}</p>
        <p v-text="getInfo"></p>
        <input type="button" value="设立" @click="getInfo='荀彧'">
        <hr>
    </div>
</body>
<script>
    new Vue({
        el:"#app",
        data:{
            msg:"诸葛亮",
            func(){
                return "周瑜";
            }
        },
        computed:{
            getMsg(){
                console.log("计算属性中的方法");
                return "司马懿";
            },
            getInfo:{
                get(){
                    return "郭嘉"
                },
                set(nv){
                    console.log(nv);
                }
            }
        }
    })
</script>
</html>